<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.9.1.js"></script>
<link type="text/css"
	href="${pageContext.request.contextPath}/css/main.css" rel="stylesheet">
<script type="text/javascript">
	$(function() {
		$("#pay").click(function () {
			var pattern1 =  /^[\u4E00-\u9FA5]{1,6}$/;
			var pattern2 = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
			var pattern3 = /^1[34578]\d{9}$/;
			if($("#receiverName").val().length==0){
				$("#receiverNameMsg").text("姓名不为空");
				return false;
			}
			else if(pattern1.test($("#receiverName").val())==false){
				$("#receiverNameMsg").text("姓名不符合要求");
				return false;
			}
			else if($("#receiverid").val().length==0){
				$("#receiveridMsg").text("身份证号不为空");
				return false;
			}
			else if(pattern2.test($("#receiverid").val())==false){
				$("#receiveridMsg").text("身份证号不符合要求");
				return false;
			}
			else if($("#receiverPhone").val().length==0){
				$("#receiverPhoneMsg").text("电话不为空");
				return false;
			}
			else if(pattern3.test($("#receiverPhone").val())==false){
				$("#receiverPhoneMsg").text("电话不符合要求");
				return false;
			}
			return true;
		});
	})
</script>
</head>
<body>
	<%@include file="head.jsp"%>
	<div class="dddiv"
		style="background-color: #F2F2F2; width: 1350px; height: 620px; margin-left: auto; margin-right: auto">
		<div class="dadiv" style="top: 20px;">
			<p
				style="background-color: #23262E; line-height: 40px; color: #F2F2F2;">我的订单</p>
			<div class="divbody" style="position: static; width: 900px;">
				<table id="zhifutable">
					<tr>
						<td>
							<form id="orderForm"
								action="${pageContext.request.contextPath}/payDtat"
								method="post">
								<table>
									<tr>
										<td>
											<table>
												<tr>
													<td>
														<p></p>
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<table style="width: 800px;">
												<tr>
													<td width="20%">房间号</td>
													<td width="70%">类型</td>
													<td width="10%">价格</td>
												</tr>
											</table>
											<table style="width: 800px;">
												<tr>
													<td width="20%">${product.roomnumber}</td>
													<td width="70%">${product.type}</td>
													<td width="10%">${product.price}</td>
												</tr>
											</table>
											<p>
												姓名：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input
													id="receiverName" name="name" type="text"
													style="width: 150px" value="${user.rname}" onkeyup="checkReceiverName();" /> <span
													id="receiverNameMsg"></span> <br /> 身份证号：<input
													id="receiverid" name="number" type="text" value="${user.usernumber}"
													style="width: 350px" onkeyup="checkReceiverid();" /> <span
													id="receiveridMsg"></span> <br /> 联系方式：<input type="text"
													id="receiverPhone" name="tel" value="${user.usertel}"
													style="width: 150px" onkeyup="checkReceiverPhone();" /> <span
													id="receiverPhoneMsg"></span>

											</p>
											<p style="text-align: right">
												<input type="submit" width="204"
													height="51" border="0" name="submit" class="button_view" style="font-size: 20px;" value="支付" id="pay">
											</p>
										</td>
									</tr>
								</table>
							</form>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</body>
</html>